package com.wc.AlgoOJ_train.train5_数据结构.c3_栈.DS0005_字符串处理1;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congege
 * @Description
 * @Date Created in 2024/2/3-11:47
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 100010;
    static char[] a = new char[N];
    static int n;
    static int top = 0;

    public static void main(String[] args) {
        n = sc.nextInt();
        for (char ch : sc.next().toCharArray()) {
            if (a[top] != ch) {
                a[++top] = ch;
            } else {
                top--;
            }
        }
        out.println(new String(a, 1, top));
        out.flush();
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    boolean hasNext() {
        while (st == null || !st.hasMoreElements()) {
            String s = nextLine();
            if (s == null) {
                return false;
            }
            st = new StringTokenizer(s);
        }

        return true;
    }
}
